home *** CD-ROM | disk | FTP | other *** search
/ Freelog 70 / Freelog070.iso / Internet / EasyPHP / easyphp1-8_setup.exe / {app} / phpmyadmin / tbl_properties_links.php < prev    next >
Encoding:
PHP Script  |  2004-10-21  |  5.5 KB  |  125 lines

  1. <?php
  2. /* $Id: tbl_properties_links.php,v 2.10 2004/10/21 10:18:12 nijel Exp $ */
  3. // vim: expandtab sw=4 ts=4 sts=4:
  4.  
  5.  
  6. /**
  7.  * Sets error reporting level
  8.  */
  9. // (removed to avoid path disclosure, not sure about why this was here)
  10. // error_reporting(E_ALL);
  11.  
  12.  
  13. // Check parameters
  14.  
  15. require_once('./libraries/common.lib.php');
  16.  
  17. PMA_checkParameters(array('db', 'table'));
  18.  
  19. echo '<!-- top menu -->' . "\n";
  20.  
  21. /**
  22.  * Count amount of navigation tabs
  23.  */
  24. $db_details_links_count_tabs = 0;
  25.  
  26.  
  27. /**
  28.  * Prepares links
  29.  */
  30. require_once('./libraries/bookmark.lib.php');
  31. $book_sql_query = PMA_queryBookmarks($db, $cfg['Bookmark'], '\'' . PMA_sqlAddslashes($table) . '\'', 'label');
  32.  
  33. if ($table_info_num_rows > 0) {
  34.     $lnk2    = 'sql.php';
  35.     $arg2    = $url_query
  36.              . '&sql_query=' . (isset($book_sql_query) && $book_sql_query != FALSE ? urlencode($book_sql_query) : urlencode('SELECT * FROM ' . PMA_backquote($table)))
  37.              . '&pos=0';
  38.     $lnk4    = 'tbl_select.php';
  39.     $arg4    = $url_query;
  40.     $ln6_stt = (PMA_MYSQL_INT_VERSION >= 40000)
  41.              ? 'TRUNCATE TABLE '
  42.              : 'DELETE FROM ';
  43.     $lnk6    = 'sql.php';
  44.     $arg6    = $url_query . '&sql_query='
  45.              . urlencode($ln6_stt . PMA_backquote($table))
  46.              .  '&zero_rows='
  47.              .  urlencode(sprintf($strTableHasBeenEmptied, htmlspecialchars($table)));
  48.     $att6    = 'onclick="return confirmLink(this, \'' . $ln6_stt . PMA_jsFormat($table) . '\')"';
  49.     $class6  = 'Drop';
  50. } else {
  51.     $lnk2    = '';
  52.     $arg2    = '';
  53.     $lnk4    = '';
  54.     $arg4    = '';
  55.     $lnk6    = '';
  56.     $arg6    = '';
  57.     $att6    = '';
  58.     $class6  = 'Drop';
  59. }
  60.  
  61. $arg7 = $url_query . '&reload=1&purge=1&sql_query=' . urlencode('DROP TABLE ' . PMA_backquote($table) ) . '&zero_rows=' . urlencode(sprintf($strTableHasBeenDropped, htmlspecialchars($table)));
  62. $att7 = 'onclick="return confirmLink(this, \'DROP TABLE ' . PMA_jsFormat($table) . '\')"';
  63. $class7 = 'Drop';
  64.  
  65.  
  66. /**
  67.  * Displays links
  68.  */
  69.  
  70. if ($cfg['LightTabs']) {
  71.     echo ' ';
  72. } else {
  73.     echo '<table border="0" cellspacing="0" cellpadding="0" width="100%" id="topmenu">' . "\n"
  74.        . '    <tr>' . "\n"
  75.        . '        <td class="nav" align="left" nowrap="nowrap" valign="bottom">'
  76.        . '            <table border="0" cellpadding="0" cellspacing="0"><tr>'
  77.        . '                <td nowrap="nowrap"><img src="' . $GLOBALS['pmaThemeImage'] . 'spacer.png' . '" width="2" height="1" border="0" alt="" /></td>'
  78.        . '                <td class="navSpacer"><img src="' . $GLOBALS['pmaThemeImage'] . 'spacer.png' . '" width="1" height="1" border="0" alt="" /></td>';
  79. }
  80.  
  81. echo PMA_printTab(($GLOBALS['cfg']['MainPageIconic'] ? '<img src="' . $GLOBALS['pmaThemeImage'] . 'b_props.png" width="16" height="16" border="0" hspace="2" align="middle" alt="'.$strStructure.'" />' : '') . $strStructure, 'tbl_properties_structure.php', $url_query)
  82.    . PMA_printTab(($GLOBALS['cfg']['MainPageIconic'] ? '<img src="' . $GLOBALS['pmaThemeImage'] . 'b_browse.png" width="16" height="16" border="0" hspace="2" align="middle" alt="'.$strBrowse.'" />' : '') . $strBrowse, $lnk2, $arg2)
  83.    . PMA_printTab(($GLOBALS['cfg']['MainPageIconic'] ? '<img src="' . $GLOBALS['pmaThemeImage'] . 'b_sql.png" width="16" height="16" border="0" hspace="2" align="middle" alt="'.$strSQL.'" />' : '') . $strSQL, 'tbl_properties.php', $url_query)
  84.    . PMA_printTab(($GLOBALS['cfg']['MainPageIconic'] ? '<img src="' . $GLOBALS['pmaThemeImage'] . 'b_search.png" width="16" height="16" border="0" hspace="2" align="middle" alt="'.$strSearch.'" />' : '') . $strSearch, $lnk4, $arg4)
  85.    . PMA_printTab(($GLOBALS['cfg']['MainPageIconic'] ? '<img src="' . $GLOBALS['pmaThemeImage'] . 'b_insrow.png" width="16" height="16" border="0" hspace="2" align="middle" alt="'.$strInsert.'" />' : '') . $strInsert, 'tbl_change.php', $url_query)
  86.    . PMA_printTab(($GLOBALS['cfg']['MainPageIconic'] ? '<img src="' . $GLOBALS['pmaThemeImage'] . 'b_tblexport.png" width="16" height="16" border="0" hspace="2" align="middle" alt="'.$strExport.'" />' : '') . $strExport, 'tbl_properties_export.php', $url_query . '&single_table=true')
  87.    . PMA_printTab(($GLOBALS['cfg']['MainPageIconic'] ? '<img src="' . $GLOBALS['pmaThemeImage'] . 'b_tblops.png" width="16" height="16" border="0" hspace="2" align="middle" alt="'.$strOperations.'" />' : '') . $strOperations, 'tbl_properties_operations.php', $url_query)
  88.    . PMA_printTab(($GLOBALS['cfg']['MainPageIconic'] ? '<img src="' . $GLOBALS['pmaThemeImage'] . 'b_empty.png" width="16" height="16" border="0" hspace="2" align="middle" alt="'.$strEmpty.'" />' : '') . $strEmpty, $lnk6, $arg6, $att6, $class6)
  89.    . PMA_printTab(($GLOBALS['cfg']['MainPageIconic'] ? '<img src="' . $GLOBALS['pmaThemeImage'] . 'b_deltbl.png" width="16" height="16" border="0" hspace="2" align="middle" alt="'.$strDrop.'" />' : '') . $strDrop, 'sql.php', $arg7, $att7, $class7)
  90.    . "\n";
  91.  
  92. if (!$cfg['LightTabs']) {
  93.     echo '                <td nowrap="nowrap"><img src="' .$GLOBALS['pmaThemeImage'] . 'spacer.png' . '" width="2" height="1" border="0" alt="" /></td>'
  94.        . '            </tr></table>' . "\n"
  95.        . '        </td>' . "\n"
  96.        . '    </tr>' . "\n"
  97.        . '</table>';
  98. } else {
  99.     echo '<br />';
  100. }
  101.  
  102. /**
  103.  * Displays table comment
  104.  */
  105. if (!empty($show_comment) && !isset($avoid_show_comment)) {
  106.     ?>
  107. <!-- Table comment -->
  108. <p><i>
  109.     <?php echo htmlspecialchars($show_comment) . "\n"; ?>
  110. </i></p>
  111.     <?php
  112. } // end if
  113.  
  114. echo "\n\n";
  115.  
  116. /**
  117.  * Displays a message
  118.  */
  119. if (!empty($message)) {
  120.     PMA_showMessage($message);
  121.     unset($message);
  122. }
  123.  
  124. ?><br />
  125.